Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Prevent deadlocks during mtime/size/etag propagation #34302

Merged
merged 2 commits into from
Oct 3, 2022

Conversation

Raudius
Copy link
Contributor

@Raudius Raudius commented Sep 28, 2022

When uploading many files in one go deadlocks can occur when propagating the changes. This PR performs two changes which should help prevent deadlocks:

  • Combines the 2 propagation queries into 1 which halves the amount of queries that can cause the deadlock to occur
  • Adds a retry loop in case the deadlock occurs

@Raudius Raudius added bug 2. developing Work in progress labels Sep 28, 2022
@Raudius Raudius force-pushed the fix/propagation_deadlock_handling branch 3 times, most recently from ff32a09 to 372e8a9 Compare September 28, 2022 10:21
@Raudius
Copy link
Contributor Author

Raudius commented Sep 28, 2022

Wondering whether we could move the retry logic to \OC\DB\QueryBuilder\QueryBuilder::executeStatement

@szaimen szaimen added this to the Nextcloud 26 milestone Sep 28, 2022
@szaimen szaimen requested review from a team, juliushaertl and CarlSchwan and removed request for a team September 28, 2022 11:42
@Raudius Raudius added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 28, 2022
@Raudius Raudius force-pushed the fix/propagation_deadlock_handling branch 3 times, most recently from 6c69d3c to 2176849 Compare September 29, 2022 17:02
@Raudius Raudius force-pushed the fix/propagation_deadlock_handling branch 2 times, most recently from 5491c55 to 3db1f6d Compare September 30, 2022 10:09
Signed-off-by: raul <raul@nextcloud.com>
…ion storage is enabled

Signed-off-by: raul <raul@nextcloud.com>
@Raudius Raudius force-pushed the fix/propagation_deadlock_handling branch from fa454bb to 95bc770 Compare October 3, 2022 11:44
@juliushaertl
Copy link
Member

/backport to stable25

@juliushaertl
Copy link
Member

/backport to stable24

@icewind1991 icewind1991 merged commit 27720d0 into master Oct 3, 2022
@icewind1991 icewind1991 deleted the fix/propagation_deadlock_handling branch October 3, 2022 14:23
@welcome
Copy link

welcome bot commented Oct 3, 2022

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22

@backportbot-nextcloud
Copy link

The backport to stable24 failed. Please do this backport manually.

@solracsf
Copy link
Member

solracsf commented Oct 7, 2022

@Raudius there is a bunch of issues about deadlocks; can you please check if this PR can help on some of them? 👍
https://github.com/nextcloud/server/search?q=deadlock&state=open&type=issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants